A virtual reality technology is a computer emulation technology using which a virtual world can be created and experienced. The virtual reality technology uses a computer to generate a simulation environment such that a user is immersed in the environment. In virtual reality, a common application scenario is multi-person coordination or a multi-person game. A great challenge to the multi-person coordination or the multi-person game is how to synchronize multiple terminals. For example, in a multi-person game, all participating terminals are located in one virtual environment, and coordinate with each other and move in the virtual environment. If the terminals are not synchronized, that is, a time difference exists between the terminals, during coordination or game battling, problems such as asynchronous and delayed pictures watched on multiple terminals are caused, thereby affecting user experience.
According to an existing method for synchronizing time between terminals, a problem of which terminal each terminal is to be synchronized with in a multi-terminal synchronization scenario may be resolved. In the method, each terminal executes the following procedure according to a specified period:
Step 1: Determine whether a synchronization time-scale of another terminal is received, and if a synchronization time-scale of another terminal is received, execute step 3, or if a synchronization time-scale of another terminal is not received, execute step 2.
Step 2: Send a synchronization time-scale of this terminal to another terminal, where the synchronization time-scale includes a priority number of this terminal and local time information of this terminal, and end an execution procedure in a current period.
Step 3: Determine whether a priority number of a source terminal included in the received synchronization time-scale is higher than a priority number of this terminal, and if the priority number of the source terminal is higher than the priority number of this terminal, execute step 4, or if the priority number of the source terminal is not higher than the priority number of this terminal, execute step 5.
Step 4: Adjust local time according to time information included in the received synchronization time-scale.
Step 5: Send a synchronization time-scale of this terminal to another terminal, where the synchronization time-scale includes the priority number of the foregoing source terminal and local time information of this terminal, and end an execution procedure in a current period.
In the foregoing synchronization method, when synchronization is performed, only a terminal priority is considered in selecting a synchronization object. However, in an actual application, a time difference may exist between terminals because of impacts of factors such as a network transmission delay, a local buffer, and a difference between user access time points. According to the synchronization method, an excessively large time adjustment range of a terminal may be caused when synchronization is performed, and therefore, a problem of an unsmooth or stalling picture watched on the terminal occurs.